-
Notifications
You must be signed in to change notification settings - Fork 634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SwiGLU further optimization in MLP bw #502
Conversation
[ghstack-poisoned]
ghstack-source-id: 12b56c35da4e6fb208bdc51ee146601dc5c35517 Pull Request resolved: #502
***PERFORMANCE A100** ``` operandfused_all <- THIS PR SwiGLUPackedFusedOp <- previous pr [--------------------------------------- swiglu_bw ---------------------------------------] | operandfused_all | eager | SwiGLUPackedFusedOp 1 threads: -------------------------------------------------------------------------------- b16 B=9456, I=1536, H=4096 | 2227.6 | 2708.3 | 2341.6 f16 B=9456, I=1536, H=4096 | 2337.5 | 2705.8 | 2339.1 f16.ac B=9456, I=1536, H=4096 | 2630.5 | 2998.5 | 2806.6 b16 B=4440, I=1536, H=4096 | 1177.9 | 1424.5 | 1246.4 f16 B=4440, I=1536, H=4096 | 1205.1 | 1418.8 | 1240.6 f16.ac B=4440, I=1536, H=4096 | 1409.0 | 1637.4 | 1541.7 b16 B=4728, I=1536, H=4096 | 1238.6 | 1493.5 | 1397.5 f16 B=4728, I=1536, H=4096 | 1274.8 | 1488.2 | 1392.7 f16.ac B=4728, I=1536, H=4096 | 1478.2 | 1710.3 | 1512.9 b16 B=4728, I=1536, H=1024 | 461.0 | 518.7 | 487.7 f16 B=4728, I=1536, H=1024 | 438.2 | 498.3 | 479.8 f16.ac B=4728, I=1536, H=1024 | 560.9 | 623.2 | 601.4 Times are in microseconds (us). ``` [ghstack-poisoned]
***PERFORMANCE A100** ``` operandfused_all <- THIS PR SwiGLUPackedFusedOp <- previous pr [--------------------------------------- swiglu_bw ---------------------------------------] | operandfused_all | eager | SwiGLUPackedFusedOp 1 threads: -------------------------------------------------------------------------------- b16 B=9456, I=1536, H=4096 | 2227.6 | 2708.3 | 2341.6 f16 B=9456, I=1536, H=4096 | 2337.5 | 2705.8 | 2339.1 f16.ac B=9456, I=1536, H=4096 | 2630.5 | 2998.5 | 2806.6 b16 B=4440, I=1536, H=4096 | 1177.9 | 1424.5 | 1246.4 f16 B=4440, I=1536, H=4096 | 1205.1 | 1418.8 | 1240.6 f16.ac B=4440, I=1536, H=4096 | 1409.0 | 1637.4 | 1541.7 b16 B=4728, I=1536, H=4096 | 1238.6 | 1493.5 | 1397.5 f16 B=4728, I=1536, H=4096 | 1274.8 | 1488.2 | 1392.7 f16.ac B=4728, I=1536, H=4096 | 1478.2 | 1710.3 | 1512.9 b16 B=4728, I=1536, H=1024 | 461.0 | 518.7 | 487.7 f16 B=4728, I=1536, H=1024 | 438.2 | 498.3 | 479.8 f16.ac B=4728, I=1536, H=1024 | 560.9 | 623.2 | 601.4 Times are in microseconds (us). ``` [ghstack-poisoned]
***PERFORMANCE A100** ``` operandfused_all <- THIS PR SwiGLUPackedFusedOp <- previous pr [--------------------------------------- swiglu_bw ---------------------------------------] | operandfused_all | eager | SwiGLUPackedFusedOp 1 threads: -------------------------------------------------------------------------------- b16 B=9456, I=1536, H=4096 | 2227.6 | 2708.3 | 2341.6 f16 B=9456, I=1536, H=4096 | 2337.5 | 2705.8 | 2339.1 f16.ac B=9456, I=1536, H=4096 | 2630.5 | 2998.5 | 2806.6 b16 B=4440, I=1536, H=4096 | 1177.9 | 1424.5 | 1246.4 f16 B=4440, I=1536, H=4096 | 1205.1 | 1418.8 | 1240.6 f16.ac B=4440, I=1536, H=4096 | 1409.0 | 1637.4 | 1541.7 b16 B=4728, I=1536, H=4096 | 1238.6 | 1493.5 | 1397.5 f16 B=4728, I=1536, H=4096 | 1274.8 | 1488.2 | 1392.7 f16.ac B=4728, I=1536, H=4096 | 1478.2 | 1710.3 | 1512.9 b16 B=4728, I=1536, H=1024 | 461.0 | 518.7 | 487.7 f16 B=4728, I=1536, H=1024 | 438.2 | 498.3 | 479.8 f16.ac B=4728, I=1536, H=1024 | 560.9 | 623.2 | 601.4 Times are in microseconds (us). ``` [ghstack-poisoned]
***PERFORMANCE A100** ``` operandfused_all <- THIS PR SwiGLUPackedFusedOp <- previous pr [--------------------------------------- swiglu_bw ---------------------------------------] | operandfused_all | eager | SwiGLUPackedFusedOp 1 threads: -------------------------------------------------------------------------------- b16 B=9456, I=1536, H=4096 | 2227.6 | 2708.3 | 2341.6 f16 B=9456, I=1536, H=4096 | 2337.5 | 2705.8 | 2339.1 f16.ac B=9456, I=1536, H=4096 | 2630.5 | 2998.5 | 2806.6 b16 B=4440, I=1536, H=4096 | 1177.9 | 1424.5 | 1246.4 f16 B=4440, I=1536, H=4096 | 1205.1 | 1418.8 | 1240.6 f16.ac B=4440, I=1536, H=4096 | 1409.0 | 1637.4 | 1541.7 b16 B=4728, I=1536, H=4096 | 1238.6 | 1493.5 | 1397.5 f16 B=4728, I=1536, H=4096 | 1274.8 | 1488.2 | 1392.7 f16.ac B=4728, I=1536, H=4096 | 1478.2 | 1710.3 | 1512.9 b16 B=4728, I=1536, H=1024 | 461.0 | 518.7 | 487.7 f16 B=4728, I=1536, H=1024 | 438.2 | 498.3 | 479.8 f16.ac B=4728, I=1536, H=1024 | 560.9 | 623.2 | 601.4 Times are in microseconds (us). ``` [ghstack-poisoned]
***PERFORMANCE A100** ``` operandfused_all <- THIS PR SwiGLUPackedFusedOp <- previous pr [--------------------------------------- swiglu_bw ---------------------------------------] | operandfused_all | eager | SwiGLUPackedFusedOp 1 threads: -------------------------------------------------------------------------------- b16 B=9456, I=1536, H=4096 | 2227.6 | 2708.3 | 2341.6 f16 B=9456, I=1536, H=4096 | 2337.5 | 2705.8 | 2339.1 f16.ac B=9456, I=1536, H=4096 | 2630.5 | 2998.5 | 2806.6 b16 B=4440, I=1536, H=4096 | 1177.9 | 1424.5 | 1246.4 f16 B=4440, I=1536, H=4096 | 1205.1 | 1418.8 | 1240.6 f16.ac B=4440, I=1536, H=4096 | 1409.0 | 1637.4 | 1541.7 b16 B=4728, I=1536, H=4096 | 1238.6 | 1493.5 | 1397.5 f16 B=4728, I=1536, H=4096 | 1274.8 | 1488.2 | 1392.7 f16.ac B=4728, I=1536, H=4096 | 1478.2 | 1710.3 | 1512.9 b16 B=4728, I=1536, H=1024 | 461.0 | 518.7 | 487.7 f16 B=4728, I=1536, H=1024 | 438.2 | 498.3 | 479.8 f16.ac B=4728, I=1536, H=1024 | 560.9 | 623.2 | 601.4 Times are in microseconds (us). ``` [ghstack-poisoned]
***PERFORMANCE A100** ``` operandfused_all <- THIS PR SwiGLUPackedFusedOp <- previous pr [--------------------------------------- swiglu_bw ---------------------------------------] | operandfused_all | eager | SwiGLUPackedFusedOp 1 threads: -------------------------------------------------------------------------------- b16 B=9456, I=1536, H=4096 | 2227.6 | 2708.3 | 2341.6 f16 B=9456, I=1536, H=4096 | 2337.5 | 2705.8 | 2339.1 f16.ac B=9456, I=1536, H=4096 | 2630.5 | 2998.5 | 2806.6 b16 B=4440, I=1536, H=4096 | 1177.9 | 1424.5 | 1246.4 f16 B=4440, I=1536, H=4096 | 1205.1 | 1418.8 | 1240.6 f16.ac B=4440, I=1536, H=4096 | 1409.0 | 1637.4 | 1541.7 b16 B=4728, I=1536, H=4096 | 1238.6 | 1493.5 | 1397.5 f16 B=4728, I=1536, H=4096 | 1274.8 | 1488.2 | 1392.7 f16.ac B=4728, I=1536, H=4096 | 1478.2 | 1710.3 | 1512.9 b16 B=4728, I=1536, H=1024 | 461.0 | 518.7 | 487.7 f16 B=4728, I=1536, H=1024 | 438.2 | 498.3 | 479.8 f16.ac B=4728, I=1536, H=1024 | 560.9 | 623.2 | 601.4 Times are in microseconds (us). ``` [ghstack-poisoned]
Codecov ReportBase: 88.37% // Head: 88.37% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## gh/danthe3rd/57/base #502 +/- ##
=====================================================
Coverage 88.37% 88.37%
=====================================================
Files 80 80
Lines 4798 4798
=====================================================
Hits 4240 4240
Misses 558 558
Flags with carried forward coverage won't be shown. Click here to find out more. Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
***PERFORMANCE A100** ``` operandfused_all <- THIS PR SwiGLUPackedFusedOp <- previous pr [--------------------------------------- swiglu_bw ---------------------------------------] | operandfused_all | eager | SwiGLUPackedFusedOp 1 threads: -------------------------------------------------------------------------------- b16 B=9456, I=1536, H=4096 | 2227.6 | 2708.3 | 2341.6 f16 B=9456, I=1536, H=4096 | 2337.5 | 2705.8 | 2339.1 f16.ac B=9456, I=1536, H=4096 | 2630.5 | 2998.5 | 2806.6 b16 B=4440, I=1536, H=4096 | 1177.9 | 1424.5 | 1246.4 f16 B=4440, I=1536, H=4096 | 1205.1 | 1418.8 | 1240.6 f16.ac B=4440, I=1536, H=4096 | 1409.0 | 1637.4 | 1541.7 b16 B=4728, I=1536, H=4096 | 1238.6 | 1493.5 | 1397.5 f16 B=4728, I=1536, H=4096 | 1274.8 | 1488.2 | 1392.7 f16.ac B=4728, I=1536, H=4096 | 1478.2 | 1710.3 | 1512.9 b16 B=4728, I=1536, H=1024 | 461.0 | 518.7 | 487.7 f16 B=4728, I=1536, H=1024 | 438.2 | 498.3 | 479.8 f16.ac B=4728, I=1536, H=1024 | 560.9 | 623.2 | 601.4 Times are in microseconds (us). ``` [ghstack-poisoned]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
***PERFORMANCE A100** ``` operandfused_all <- THIS PR SwiGLUPackedFusedOp <- previous pr [--------------------------------------- swiglu_bw ---------------------------------------] | operandfused_all | eager | SwiGLUPackedFusedOp 1 threads: -------------------------------------------------------------------------------- b16 B=9456, I=1536, H=4096 | 2227.6 | 2708.3 | 2341.6 f16 B=9456, I=1536, H=4096 | 2337.5 | 2705.8 | 2339.1 f16.ac B=9456, I=1536, H=4096 | 2630.5 | 2998.5 | 2806.6 b16 B=4440, I=1536, H=4096 | 1177.9 | 1424.5 | 1246.4 f16 B=4440, I=1536, H=4096 | 1205.1 | 1418.8 | 1240.6 f16.ac B=4440, I=1536, H=4096 | 1409.0 | 1637.4 | 1541.7 b16 B=4728, I=1536, H=4096 | 1238.6 | 1493.5 | 1397.5 f16 B=4728, I=1536, H=4096 | 1274.8 | 1488.2 | 1392.7 f16.ac B=4728, I=1536, H=4096 | 1478.2 | 1710.3 | 1512.9 b16 B=4728, I=1536, H=1024 | 461.0 | 518.7 | 487.7 f16 B=4728, I=1536, H=1024 | 438.2 | 498.3 | 479.8 f16.ac B=4728, I=1536, H=1024 | 560.9 | 623.2 | 601.4 Times are in microseconds (us). ``` [ghstack-poisoned]
ghstack-source-id: b1bead3ade9c469dc859d3576b8834488845e57c Pull Request resolved: #502
Saves memory and is slightly faster
Stack from ghstack (oldest at bottom):
*PERFORMANCE A100